﻿using System;
using System.IO;

namespace Narwhunderful.Aphelia.Framework.IO
{

    public class Logger
    {

        static string _filePath = null;
        static StreamWriter _streamWriter = null;

        public Logger()
        {
#if WINDOWS
            _filePath = AppDomain.CurrentDomain.BaseDirectory + @"\log.txt";
#endif
        }

        public void Log(string message)
        {
            if (_filePath == null) return;
            _streamWriter = new StreamWriter(_filePath, true);
            _streamWriter.WriteLine(DateTime.Now + "." + DateTime.Now.Millisecond.ToString("000") + " - " + message);
            _streamWriter.Close();
        }

    }

}
